//
//  RadioButton.h
//  RadioButton
//
//  Created by cuibaoyin on 14-11-17.
//  Copyright (c) 2014年 cby. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol RadioButtonDelegate;

@interface RadioButton : UIView

@property (weak, nonatomic) id<RadioButtonDelegate> delegate;

/**
 *  选项个数
 */
@property(readonly, nonatomic) NSUInteger numberOfRadio;

/**
 *  被选中的
 */
@property(readwrite, nonatomic) NSInteger selectedRadioIndex;

/**
 *  选项的未选中的图片
 */
@property(strong, nonatomic) UIImage* normalRadioImage;

/**
 *  选项的选中图片
 */
@property(strong, nonatomic) UIImage* selectedRadioImage;

/**
 *  所有选项的字体Font
 */
@property(strong, nonatomic) UIFont* titleFont;

/**
 *  所有选项的字体颜色
 */
@property(strong, nonatomic) UIColor* titleColor;

/**
 *  所有选项的字体Attribute
 */
@property(strong, nonatomic) NSMutableDictionary* titleAttribute;

- (instancetype)initWithFrame:(CGRect) frame titleArray:(NSArray *)array;

@end

@protocol RadioButtonDelegate <NSObject>

@optional
/**
 *  RadioButton的第index的cel被选中
 */
- (void)radioButton:(RadioButton *)radioButton didSelectItemAtIndexPath:(NSInteger)index;

/**
 *  RadioButton的高度发生变化
 */
- (void)radioButton:(RadioButton *)radioButton heightChanged:(CGFloat)newHeight;

@end